package com.central.apps.controller;

import com.central.app.service.HandlerService;
import com.central.common.util.ToolUtil;
import com.central.common.web.PageResult;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.*;

/**
 * 采购台账流程历史
 */
@RestController
@RequestMapping("/flowOpinion")
public class FlowOpinionController {

    @Autowired
    private HandlerService handlerService;

    /**
     *
     * @return
     */
    @PostMapping("/getList")
    public PageResult<Map<String, Object>> getitemapplys(@RequestBody Map<String,Object> params) throws Exception {
        String app = MapUtils.getString(params, "app");
        String bizid = MapUtils.getString(params, "bizid");
        Integer limit = MapUtils.getInteger(params, "limit");
        Integer page = MapUtils.getInteger(params, "page");
        String sql = "select * from gq_flowopinion where app = '" + app + "' and bizid = '" + bizid + "'";
        PageResult<Map<String, Object>> mapPageResult = handlerService.pageList(page==null?1:page, limit==null?10:limit, sql);
        return mapPageResult;
    }
}
